//
//  OBViewModel.h
//  WeChat
//
//  Created by 黄柳姣 on 2018/4/28.
//  Copyright © 2018年 obally. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol OBViewModelServices;
/// 传递导航栏title的key：例如 导航栏的title...
FOUNDATION_EXTERN NSString *const OBViewModelTitleKey;

@interface OBViewModel : NSObject

- (instancetype)initWithServices:(id<OBViewModelServices>)services params:(NSDictionary *)params;

@property(nonatomic,strong,readonly) id<OBViewModelServices> services;

@property(nonatomic,copy,readonly) NSDictionary *params;
//naviItem.title
@property(nonatomic,copy,readwrite) NSString *title;
/// 返回按钮的title，default is nil 。
/// 如果设置了该值，那么当Push到一个新的控制器,则导航栏左侧按钮的title为backTitle
@property (nonatomic, readwrite, copy) NSString *backTitle;
/// The callback block.
@property (nonatomic, readwrite, copy) VoidBlock_id callback;
/// A RACSubject object, which representing all errors occurred in view model.
@property (nonatomic, readonly, strong) RACSubject *errors;
/** should fetch local data when viewModel init . default is YES */
@property (nonatomic, readwrite, assign) BOOL shouldFetchLocalDataOnViewModelInitialize;
/** should request data when viewController videwDidLoad . default is YES*/
@property (nonatomic, readwrite, assign) BOOL shouldRequestRemoteDataOnViewDidLoad;
@property (nonatomic, readwrite, assign) BOOL shouldRequestRemoteDataOnViewWillAppear;
/// will disappear signal
@property (nonatomic, strong, readonly) RACSubject *willDisappearSignal;

/// Whether the interactive pop gesture is disabled when contained in a navigation
/// stack. (是否取消掉左滑pop的功能（栈底控制器无效），默认为NO，不取消)
@property (nonatomic, readwrite, assign) BOOL interactivePopDisabled;

/// Indicate this view controller prefers its navigation bar hidden or not,
/// checked when view controller based navigation bar's appearance is enabled.
/// Default to NO, bars are more likely to show.
/// 是否隐藏该控制器的导航栏 默认是不隐藏 (NO)
@property (nonatomic, readwrite, assign) BOOL prefersNavigationBarHidden;

/// 是否隐藏该控制器的导航栏底部的分割线 默认不隐藏 （NO）
@property (nonatomic, readwrite, assign) BOOL prefersNavigationBarBottomLineHidden;

/// 是否让IQKeyboardManager的管理键盘的事件 默认是YES（管理）
@property (nonatomic, readwrite, assign) BOOL keyboardEnable;

/// 是否键盘弹起的时候，点击其他局域键盘弹起 默认是 YES
@property (nonatomic, readwrite, assign) BOOL shouldResignOnTouchOutside;

- (void)initialize;
@end
